Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 7 - Process Management / Process Management Reference
Functions / Working With System Tasks


OTCreateSystemTask

Allows a function to be executed at the next system task time.

C INTERFACE
long OTCreateSystemTask (OTProcessProcPtr proc, 
                         void* arg)
C++ INTERFACES
None. C++ applications use the C interface to this function.

PARAMETERS
proc
A pointer to the process callback function you want executed at system task time.
arg
A pointer to application-defined data that Open Transport can pass to your callback function. Pass NULL if you do not want this data passed. If you are creating more than one of the same kind of task, you can use different values for arg to distinguish between the tasks.
DESCRIPTION
The OTCreateSystemTask function creates a system task that you can schedule for execution at the next system task time. The task contains a pointer to the process callback function specified by the proc parameter. At the next system task time, Open Transport calls your process callback function, passing it the arg parameter and, for the 68000-family of Macintosh computers only, restoring the A5 global world to what it was when you originally called OTCreateSystemTask.

This function returns a reference that you can use to identify a task in other system task functions. If the return value is 0, then there is not enough memory to allocate the necessary data.

SEE ALSO
To schedule a task for execution at system task time, call the OTScheduleSystemTask function (page 7-10).

To destroy a system task created with the OTCreateSystemTask function, call the OTDestroySystemTask function (page 7-13).

To cancel a task scheduled for execution at system task time, call the OTCancelSystemTask function (page 7-12).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996